package com.javastudy.autowiredStudy.strategy;

import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * @author madonghui
 * @title: StringToStringBuilderListConverter
 * @projectName javaproject
 * @description: TODO
 * @date 2021/9/59:16 上午
 */
@ListConverter(value = ConverterConstants.stringToStringBuilder,name = "string集合转stringBuilder集合")
@Repository
public class StringToStringBuilderListConverter implements Function<List<String>,List<StringBuilder>> {
    @Override
    public List<StringBuilder> apply(List<String> strings) {
        return strings.stream().map(StringBuilder::new).collect(Collectors.toList());
    }
}
